package main

import "fmt"

type Person struct {
	name string
	sex  byte
	age  int
}

type Student struct {
	Person
	id int
	addr string
}

func main() {
	//顺序初始化
	s1 := Student{Person{"mike", 'm', 18}, 1, "sz"}
	fmt.Printf("s1=%+v\n", s1)

	//部分成员初始化
	s3 := Student{Person:Person{"lily", 'f', 19}, id:2}
	fmt.Printf("s3=%+v\n", s3)

	//部分成员初始化
	s4 := Student{Person:Person{name:"tom"}, id:3}
	fmt.Printf("s4=%+v\n", s4)
}
